'use strict';

module.exports = app => {
  const { STRING, INTEGER, TEXT, DATE, BOOLEAN } = app.Sequelize;

  const Setting = app.model.define('setting', {
      id: {
        type: INTEGER,
        primaryKey: true,
        allowNull: false,
        autoIncrement: true
      },
      title: {
        type: STRING,
        allowNull: false
      },
      content: {
        type: TEXT,
        allowNull: false
      },
      active: {
        type: BOOLEAN,
        allowNull: false,
        defaultValue: false
      },
      created_at: DATE,
      updated_at: DATE
  })

  return Setting;
}